/blog/

Writing a CMS from scratch again

created: 2021-02-01T01:26:06Z
modified: 2021-02-02T05:11:04Z

I do this a lot, write a CMS from scratch, it’s always an interesting exercise. I know the problems to be tackled well from many years of working with Drupal before they made their ill fated move to OOP. But rarely do I get to a point where I think I can start tackling problems with these custom CMS’s like I used to with Drupal. But it looks like I’m getting there this time. I’d like to think this is really something.

What I’ve built is in all practicality a static site generator, but could easily be deployed as a dynamic site generator cause that’s how it runs locally. The content all lives in simple text files, but of different types that can be combined together to support complex functionality. So you could write a simple article in a Markdown file, add an HTML file to display say a canvas element(like a little tsParticles demo mixed in with a Markdown page), create a JSON file to supply some data for the page, and then reference and initiate a Javascript to display what you need with a little inline script snippet. Templates and styles can be set per section and overridden in individual pages.

There are still a few minor quirks to the CMS lib to iron out before I publish the 0.0.1 release. And the CLI app, which is the only direct interface is barely even started, not that it’s necessary given the flat file nature of the system. Just grab a text editor and start banging out markdown files and directories and you have a site. The exporter is a bash script but I want to move it to the CLI and integrate it with a file watcher. But overall I think this CMS will have more staying power for me because I have a clearer idea of what I want out of it and I’ve finally moved beyond what I used to do with Drupal (at least for composition and display). All in a lighter, faster package, written in Rust.

  • Creative Commons License
  • Author: Gatewaynode